Skip to content

fix: make Qt5 (mips64el) build link DTK5 and deepin-pdfium5 - #463

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:fix/batchprint-qt5-dtk-include
Nov 27, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
pengfeixx:fix/batchprint-qt5-dtk-include

Conversation

@pengfeixx

@pengfeixx pengfeixx commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The shuttle mips64el package build fails in two stages when falling back to Qt5 (the chroot has no qmake6, so debian/rules picks Qt5):

  1. Compile failure at ~50% — batchprint-convert reuses reader sources (Global.cpp etc. include DApplication/DGuiApplicationHelper), but the target only received DTK include paths via Qt6 imported targets. In Qt5/DTK5 variable mode (DTK_USE_TARGETS=OFF) it got no DTK includes:
    reader/app/Global.cpp:13:10: fatal error: DGuiApplicationHelper: No such file or directory
    
  2. Link failure after that is fixed — undefined reference to DPdfPage::allTextLooseRects(int&, QStringList&, QVector<QRectF>&). libdeepin-pdfium and libdeepin-pdfium5 are built against Qt6/Qt5 respectively; the C++ symbol mangling of Qt container types is incompatible, so a Qt5 consumer cannot link the Qt6-built variant.

Changes

  • CMakeLists.txt: move the Qt detection before the pdfium check; select the pkg-config module per Qt version (deepin-pdfium for Qt6, deepin-pdfium5 for Qt5)
  • reader/CMakeLists.txt, batch-print/CMakeLists.txt, tests/CMakeLists.txt: use ${DEEPIN_PDFIUM_MODULE} (tests is a standalone project and gets its own selection)
  • batch-print/CMakeLists.txt: when DTK_USE_TARGETS is OFF, pass ${DtkWidget,Gui,Core}_INCLUDE_DIRS / _LIBRARIES to batchprint-convert (mirrors what the reader target already does)
  • debian/control: add libdeepin-pdfium5-dev (>= 1.5.7) [mipsel mips64el] | libdeepin-pdfium-dev (>= 1.5.8) alternative

No C++ source changes; the Qt6 build path is untouched.

Testing

  • Real mips64el device with Qt6 dev packages removed (mirrors the shuttle Qt5 chroot): full dpkg-buildpackage -b completes and produces deepin-reader_6.6.5_mips64el.deb; configure logs Found Qt version: 5, module: deepin-pdfium5
  • Same device with Qt6 restored (earlier run): full build produced the Qt6 deb — Qt6 path unchanged
  • git interpret-trailers --parse on the commit message
  • Shuttle mips64el build passes end to end after merge
  • amd64/arm64 CI builds green

PMS: TASK-398545

Summary by Sourcery

Enable successful Qt5 builds on mips architectures while preserving the existing Qt6 build path.

Bug Fixes:

  • Fix Qt5 builds by selecting the Qt-compatible deepin-pdfium5 dependency and supplying DTK5 include and link settings for batch conversion.

Enhancements:

  • Select the PDF engine module according to the detected Qt version across the main, reader, batch-print, and test builds.

Build:

  • Add architecture-specific packaging dependencies for the Qt5 deepin-pdfium development package.

1. batchprint-convert reused reader sources but only got DTK
   include paths via imported targets (Qt6); in Qt5/DTK5
   variable mode it built without any DTK includes and failed
   with "DApplication: No such file or directory" on shuttle.
2. libdeepin-pdfium and libdeepin-pdfium5 are built against
   Qt6/Qt5 respectively; their C++ ABI (QStringList/QVector
   mangling) is incompatible. The Qt5 build linked the Qt6
   variant and failed with undefined allTextLooseRects.
3. Detect Qt before the pdfium check and pick the module per
   Qt version (deepin-pdfium / deepin-pdfium5), use the same
   variable in reader/batch-print/tests, add the
   libdeepin-pdfium5-dev alternative for mipsel/mips64el in
   debian/control, and pass DtkWidget/Gui/Core INCLUDE_DIRS/
   LIBRARIES to batchprint-convert when DTK_USE_TARGETS is off.
4. Verified on a real mips64el Qt5 environment: full
   dpkg-buildpackage completes and produces the deb; Qt6 path
   unchanged (re-verified earlier on the same machine).

Influence:
1. Verify the shuttle mips64el deb build completes end to end.
2. Verify amd64/arm64 (Qt6) builds are unaffected: configure
   picks deepin-pdfium and binaries link normally.
3. Spot check PDF word extraction / batch print on a Qt5 build.

fix: Qt5(mips64el)构建补齐 DTK5 头文件并链接 deepin-pdfium5

1. batchprint-convert 复用 reader 源码,但 DTK 头文件路径此前
   仅通过 Qt6 导入目标提供;Qt5/DTK5 变量模式下无任何 DTK
   路径,shuttle 上报 "DApplication: No such file or directory"。
2. libdeepin-pdfium 与 libdeepin-pdfium5 分别基于 Qt6/Qt5 构建,
   C++ ABI(QStringList/QVector 名字修饰)互不兼容,Qt5 构建链
   Qt6 变体导致 allTextLooseRects 符号找不到。
3. 将 Qt 检测提前,按 Qt 版本选择 pdfium 模块
   (deepin-pdfium / deepin-pdfium5),reader/batch-print/tests
   统一使用该变量;debian/control 为 mipsel/mips64el 增加
   libdeepin-pdfium5-dev 备选;DTK_USE_TARGETS 关闭时向
   batchprint-convert 传递 DtkWidget/Gui/Core 的 INCLUDE_DIRS
   与 LIBRARIES。
4. 已在真实 mips64el Qt5 环境验证:dpkg-buildpackage 全量通过
   并出包;Qt6 路径在同一台机器上此前已验证不受影响。

Influence:
1. 验证 shuttle mips64el 构建可端到端完成并出包。
2. 验证 amd64/arm64(Qt6)构建不受影响:configure 选择
   deepin-pdfium 且链接正常。
3. 抽查 Qt5 构建产物的 PDF 取词与批量打印功能。

Log: No user-facing changes
PMS: TASK-398545
@sourcery-ai

sourcery-ai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Reviewer's Guide

Configuration

Select the PDFium package variant from the detected Qt version throughout the build, and declare the matching Qt5 package dependency for affected architectures.

  • CMakeLists.txt L21-36, L187 (removed lines)
  • batch-print/CMakeLists.txt L12-13
  • debian/control L10
  • reader/CMakeLists.txt L6-7
  • tests/CMakeLists.txt L15 (removed lines), L19-27

Provide DTK5 include paths and libraries to batchprint-convert when imported DTK targets are unavailable.

  • batch-print/CMakeLists.txt L107-119

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="CMakeLists.txt" line_range="32" />
<code_context>
+if(QT_VERSION_MAJOR MATCHES 6)
+    set(DEEPIN_PDFIUM_MODULE deepin-pdfium)
+else()
+    set(DEEPIN_PDFIUM_MODULE deepin-pdfium5)
+endif()
 find_package(PkgConfig REQUIRED)
</code_context>
<issue_to_address>
**Qt5 configuration stops with allowed dependencies**

When a Qt5 build resolves its PDFium dependency to only `libdeepin-pdfium-dev`, cMake's `pkg_check_modules` requires `deepin-pdfium5`, so configuration stops despite the permitted generic development package and the build never starts.

Make the Qt5 pkg-config module requirement match the PDFium development package that Debian can provide for Qt5.

Also at `CMakeLists.txt:35`.
</issue_to_address>

### Comment 2
<location path="CMakeLists.txt" line_range="33" />
<code_context>
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro -Wl,-z,now")
 endif()

+# 查找Qt版本(需先于 PDF 引擎模块选择:Qt5 构建走 deepin-pdfium5)
</code_context>
<issue_to_address>
**Qt5 qmake builds keep wrong PDF engine**

When a caller uses the documented qmake build with Qt5, `reader/src.pri` still requests the Qt6 `deepin-pdfium` pkg-config module, so the documented Qt5 qmake build links an ABI-incompatible engine and fails with unresolved PDFium symbols.

Select `deepin-pdfium5` in the qmake configuration when building with Qt5, including for tests.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread CMakeLists.txt
if(QT_VERSION_MAJOR MATCHES 6)
set(DEEPIN_PDFIUM_MODULE deepin-pdfium)
else()
set(DEEPIN_PDFIUM_MODULE deepin-pdfium5)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium · Qt5 configuration stops with allowed dependencies

When a Qt5 build resolves its PDFium dependency to only libdeepin-pdfium-dev, cMake's pkg_check_modules requires deepin-pdfium5, so configuration stops despite the permitted generic development package and the build never starts.

Make the Qt5 pkg-config module requirement match the PDFium development package that Debian can provide for Qt5.

Also at CMakeLists.txt:35.

Prompt for AI agents
In `CMakeLists.txt` at line 32:

**Qt5 configuration stops with allowed dependencies**

When a Qt5 build resolves its PDFium dependency to only `libdeepin-pdfium-dev`, cMake's `pkg_check_modules` requires `deepin-pdfium5`, so configuration stops despite the permitted generic development package and the build never starts.

Make the Qt5 pkg-config module requirement match the PDFium development package that Debian can provide for Qt5.

Also at `CMakeLists.txt:35`.

Comment thread CMakeLists.txt
set(DEEPIN_PDFIUM_MODULE deepin-pdfium)
else()
set(DEEPIN_PDFIUM_MODULE deepin-pdfium5)
endif()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟠 High · Qt5 qmake builds keep wrong PDF engine

When a caller uses the documented qmake build with Qt5, reader/src.pri still requests the Qt6 deepin-pdfium pkg-config module, so the documented Qt5 qmake build links an ABI-incompatible engine and fails with unresolved PDFium symbols.

Select deepin-pdfium5 in the qmake configuration when building with Qt5, including for tests.

Prompt for AI agents
In `CMakeLists.txt` at line 33:

**Qt5 qmake builds keep wrong PDF engine**

When a caller uses the documented qmake build with Qt5, `reader/src.pri` still requests the Qt6 `deepin-pdfium` pkg-config module, so the documented Qt5 qmake build links an ABI-incompatible engine and fails with unresolved PDFium symbols.

Select `deepin-pdfium5` in the qmake configuration when building with Qt5, including for tests.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, pengfeixx

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@pengfeixx

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit d27f638 into linuxdeepin:master Nov 27, 2026
9 checks passed
@pengfeixx
pengfeixx deleted the fix/batchprint-qt5-dtk-include branch November 27, 2026 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants